home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 June
/
Macworld (1999-06).dmg
/
Shareware World
/
Info
/
For Developers
/
MacZoop2.0.sea
/
MacZoop2.0
/
Projects
/
Basic MacZoop Project
/
ProjectSettings.h
< prev
next >
Wrap
Text File
|
1999-02-11
|
15KB
|
377 lines
/*************************************************************************************************
*
*
* MacZoop 2.0 - "the framework for the rest of us"
*
*
*
* ProjectSettings.h -- compiler flags and other settings specific to your
* project. Copy this file and change things as you
* need them. This file has the default settings.
*
*
* © 1996, Graham Cox
*
*
*
*
*************************************************************************************************/
#pragma once
#ifndef __PROJECTSETTINGS__
#define __PROJECTSETTINGS__
#define ON 1
#define OFF 0
//----------------------------------------------------------------------------------------------
// ************* START-UP APPLICATION CONSTRUCTION **************
// VERY IMPORTANT: Here, you must declare the name of your application class (a subclass of
// ZApplication). MacZoop requires this name in order to correctly start up your app. For
// example, if your app class is called "ZMyFunkyApplication", then set APP_CLASS_NAME to
// exactly this name. Do not put the name in quotes, nor put a semi-colon after it. It is
// also ESSENTIAL that the header file that describes your class is called <APP_CLASS_NAME>.h
// otherwise the project will not build. So, e.g. your header file for ZFunkyApplication MUST
// be named ZFunkyApplication.h
#define APP_CLASS_NAME ZApplication
// a similar technique is available if your app is simple, and would only be subclassing
// ZApplication in order to make a different kind of default window object. If this is the
// case, you can avoid this subclassing requirement by defining a macro called
// USER_DEFAULT_WINDOW_TYPE (spelt exactly thus). You should set this macro to the exact name
// of your default window class. e.g:-
// #define USER_DEFAULT_WINDOW_TYPE ZMyFunkyWindow
// Note that by default, this is NOT defined, and ZApplication thus makes ZWindow objects
// as standard. Remember to set the above (APP_CLASS_NAME) to ZApplication if you are taking
// advantage of this.
//----------------------------------------------------------------------------------------------
// ZApplication compilation options:
// Every application should have a "signature"- a 32-bit number that is uniquely assigned to it.
// Apple keep a register of application signatures to ensure they are unique. The signature is
// declared as part of the 'BNDL' resource, if you have one. MacZoop will pick up this value
// and assign it to <gAppSignature>. If you do not have a BNDL resource, or for backward
// compatibility want to set the signature yourself, set the following to OFF: (default ON)
#define USE_SIGNATURE_FROM_BNDL ON
// if the above is OFF, you can set up your signature here.The default signature of this
// application is 'ZAPP' (n.b. NOT registered with Apple!).
#if USE_SIGNATURE_FROM_BNDL == OFF
#define kApplicationSignature 'ZAPP'
#else
// you can automatically build the application's list of openable file types by looking at
// the 'FREF' resources that it has. One of these will generally be 'APPL' or other executable
// type which are NEVER added to the list, but other file types are if this is ON. This is only
// available if USE_SIGNATURE_FROM_BNDL is also ON (Default: OFF):
#define CHECK_FREF_RESOURCE_TYPES ON
#endif
//----------------------------------------------------------------------------------------------
// to deal with low-memory crises, ZApplication allocates and manages a "shortage fund" which
// it can release when the memory manager gets into trouble. BY default this is 64K, but you
// can set it to whatever you want by setting this #define. This fund is designed to cope with
// dire emergencies only- you may need to do more sophisticated memory management for complex
// or memory-intensive applications.
#define kShortageFundSize 65536 // leave 64K in reserve for emergencies.
//----------------------------------------------------------------------------------------------
// By default, MacZoop will work like a normal Mac application in that it will open a new
// "untitled" window at startup if no files are passed to it. If you want to make a "faceless"
// application, turn OFF the following define to suppress the opening of the initial window.
// Default is ON
#define MAKE_UNTITLED_STARTUP_WINDOW ON
//----------------------------------------------------------------------------------------------
// When the app quits, time is saved by not bothering to actively release a number of objects
// and handles, etc. The MacOS will free the entire application heap in one go when the app
// terminates, so this is quite OK, and makes quitting happen faster. However, if you need
// a comprehensive clean-up for some reason, or a relying on particular destructors being
// called on quit, set this to ON.
// Default is OFF (faster quitting)
#define _SLOW_BUT_SURE_DESTRUCTION OFF
//----------------------------------------------------------------------------------------------
// comment out the following if you do not want printing support
// Default is ON
#define PRINTING_ON OFF
// Printing options:
// If you want to use a progress bar when printing ("Spooling page <n> of <y> pages") then set
// this define to ON.
// Default is OFF
#define _PRINT_USING_PROGRESS_BAR OFF
//----------------------------------------------------------------------------------------------
// if you wish to use the Appearance Manager-savvy parts of MacZoop when running under
// System 8, set the following to ON. If undefined, will implement standard System 7 behaviour.
// If you compile with this defined, things should still work on previous system versions.
// Note that if you are building an appearance aware app with MacZoop, you need to link with
// the AppearanceLib library as well as define this.
// Default is OFF
#define APPEARANCE_MGR_AWARE OFF
#if APPEARANCE_MGR_AWARE
#include <appearance.h>
#ifndef kThemeStateInactive
#define kThemeStateInactive kThemeStateDisabled
#endif
#endif
// if you wish to support proportional thumbs in scrollbars, set this to ON. Also requires
// Appearance 1.1 or later and "ControlsLib" in your project. This setting only affects scrollbars
// that are part of ZScroller, not those in lists, etc, which are managed by the Mac toolbox.
#if APPEARANCE_MGR_AWARE
#define USE_PROPORTIONAL_SCROLLBARS OFF
#endif
//----------------------------------------------------------------------------------------------
// ZWindowManager compilation options:
// HIG says that all floating windows are peers of one another and thus all show the active
// state regardless of their ordering within their layer. Some programmers may prefer the
// other common behaviour where only one floater is active at a time. To get this latter
// behaviour, set the following define to OFF and recompile. n.b. windows will still receive
// their activate/deactivate messages- this only affects the window hiliting.
// Default is ON
#define _ALL_FLOATERS_ACTIVE ON
// this window manager does not allow activate events to be sent by the mac toolbox, but
// instead calls the event handler directly with the relevant parameters. In most cases, your
// code won't be aware of this, but if you really need to get a "real" activation event,
// comment in the following define. This makes the window manager post a real activation event
// instead of "faking" one.
// Default is OFF
#define _ACTIVATE_EVENTS_ARE_REAL OFF
// When a window is picked up by its title bar for dragging, it is first brought to the front
// of its layer (unless the command key is down). This selection can result in a non-updated
// area of the window appearing until the drag is completed, at which point the window is
// refreshed. This is the normal behaviour. However, this window manager object can prevent
// this by forcing the update to occur immediately. This may give better perceived performance,
// since the user won't be waiting for the update to come along later. To get this behaviour,
// comment in the following:
// Default is ON
#define _UPDATE_ON_SELECT ON
// Similarly, in the same situation, we select the window before dragging it. This is not what
// DragWindow does- it selects the window after dragging. If you really desire this behaviour
// instead, comment in the following:
// Default is OFF
#define _DRAGWINDOW_COMPATIBLE OFF
// If you are taking advantage of the automatic support for a "Windows" menu, you might want to
// list the windows alphabetically. The default is to list them in order of creation. To list
// alphabetically, turn ON the following:
// Default is OFF
#define _ALPHABETICAL_WINDOWS_MENU OFF
// If you's like command key equivalents cmd-0 to cmd-9 for the first ten windows in this menu,
// turn ON the following:
// Default is ON
#define _ENUMERATE_WM_CMDS ON
// if you'd like windows that have an associated file to popup a directory menu when their
// titles are command-clicked, set this to ON. A menu choice opens the relevant directory
// window in the Finder. The code required to implement this is available separately-
// called "DirectoryPopup" © by Marco Piovanelli. A version of this code is available in the
// More Classes:Goodies & Extras:DirectoryPopup folder.
// Default is OFF
#define _USE_DIR_POPUP OFF
//----------------------------------------------------------------------------------------------
// ZMenuBar & ZEventHandler compilation options:
// comment IN for automatic mouse-aware menubar hiding (implemented in ZEventHandler)
// Default is OFF
#define _AUTO_MBAR_HIDING OFF
//----------------------------------------------------------------------------------------------
// ZFile compilation options:
// ZFile has methods for automatically building custom icons for a file. This support requires
// that you have "PixmapUtils.cpp" in your project, which adds some overhead. If you don't
// need this support, turn off following which will make things smaller.
// Default is ON
#define _CUSTOM_ICON_SUPPORT OFF
//----------------------------------------------------------------------------------------------
// Zoom rect effect options:
// if you have the drag manager, and your app links to DragLib, and this define is ON, then
// every window you open will have a finder-like "zoom" rect effect. The source of this rect
// is set by SetLocalZoomSource or SetGlobalZoomSource in ZWindowManager.h. This is automatically
// set by menu items, dialog button clicks, etc. You only need to deal with this if you have
// an interface element that spawns a window that is not a menu or a button.
// Default is ON
#define _ZOOM_RECT_FX ON
//----------------------------------------------------------------------------------------------
// Window save/restore features:
// MacZoop can save and restore your window positions by storing a 'Wpos' resource for a window
// in a nominated resource file (including prefs). Your code has to make the calls for your own
// document windows, but some automatic features are also provided, especially for dialogs.
// These flags control the implementation.
// enables the code in general- your project will require at least ZResourceFile and ZPrefsFile
// if ON. The basic code is implemented in ZWindowManager, with a simpler API in ZWindow.
#define _WPOS_WINDOW_PLACEMENT OFF
// enable automatic save/restore for dialogs and floaters:
#if _WPOS_WINDOW_PLACEMENT
#define _AUTO_WPOS_FOR_DIALOGS ON
#define _AUTO_WPOS_FOR_FLOATERS ON
#endif
//----------------------------------------------------------------------------------------------
// progress dialog options:
// if OFF, your code needs to check for a cancel of the progress dialog by checking the return
// value of InformProgress(). If ON, the dialog itself throws a cancel exception making it
// even easier to use- however, you may need an exception handler to clean up properly.
// Default is ON
#define _CANCEL_PROGRESS_THROWS_EXCEPTION ON
//----------------------------------------------------------------------------------------------
// Navigation Services options:
// MacOS 7.5.5 and later can use the new Apple Navigation Services instead of StandardFile to
// choose files for opening, saving, etc. This interface is extremely groovy and will be the
// only one supported under Mac OSX. MacZoop can use this right now if you have it installed. If
// you desperately want the old interfaces, turn this option OFF (default is ON). Note that
// you'll get the old interfaces anyway if Navigation is not installed or your system is too
// old. n.b. if ON, you need to add NavigationLib to your project.
// Default is ON
#define _USE_NAVIGATION_SERVICES OFF
// Navigation services provides some standard alerts for Save Changes and Revert. At present,
// these are slightly buggy in that they don't position very well over floating windows, and
// in any case the MacZoop ones look nicer. This this additional setting allows you to choose
// which ones to use. Note that using the MacZoop ones does NOT affect Carbon compatibility.
#if _USE_NAVIGATION_SERVICES
#define _USE_NAV_SAVEREVERT_ALERTS OFF
#endif
//---------------------------------------------------------------------------------------------
// Mouse tracking
// To install a default mouse tracking object in ZWindow and ZScroller, set this to ON. This
// provides a mouse tracking and feedback loop in response to a click in a window automatically,
// which you can receive messages from as it tracks. For backward compatibility, this is
// defaulted to OFF
#define _INSTALL_STD_MOUSE_TRACKING OFF
//---------------------------------------------------------------------------------------------
// Dialog Options
// MacZoop 2.0 blends the old, obsolete ZAdvancedDialog and ZAMDialog classes from 1.x into a
// unified ZDialog class, that supports all items in a standard, consistent way. The original
// so-called "magic" items previously part of ZAdvancedDialog are now built-in to ZDialog, but
// to avoid importing all this code unnecessarily in simpler projects, you can turn off these
// extensions with this flag.
// Default is OFF
#define _DIALOG_EXTENSIONS OFF
//---------------------------------------------------------------------------------------------
// As a convenience feature, ZCommander is capable of creating and opening a dialog box with
// one call to OpenSubDialog(). However, because ZCommander is a required class but ZDialog
// is not, if you want to leave ZDialog out of a project, you need to turn OFF the following
// setting, which removes all dialog references from the ZCommander code.
// Default is ON
#define _ZCOMMANDER_DIALOG_AWARE OFF
#endif